﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApprovePage.aspx.cs" Inherits="AviagePortal.Layouts.AviagePortal.ApprovePage" DynamicMasterPageFile="~masterurl/default.master" %>

<asp:Content ID="PageHead" ContentPlaceHolderID="PlaceHolderAdditionalPageHead" runat="server">
    <script type="text/javascript">
        String.prototype.IsNullEmptyOrSpace = function () {
            if (this == null) return true;
            return this.replace(/\s/g, '').length == 0;
        };

        function ValidateInput() {
            var changeDiscriptionTextArea = document.getElementById("ctl00_PlaceHolderMain_ApproveCommentsTextarea");
            if (changeDiscriptionTextArea.innerHTML.IsNullEmptyOrSpace()) {
                alert("Please input the comments");
                return false;
            }
            else {
                return true;
            }
        }
    </script>
</asp:Content>

<asp:Content ID="Main" ContentPlaceHolderID="PlaceHolderMain" runat="server">
    <asp:Label ID="ErrorLabel" runat="server" Text="Only user in the SharePoint group AviagePortalApprover can access this page" ForeColor="Red" Font-Bold="true" Visible="false"></asp:Label>
     <div runat="server" ID="ErrorMessageLiteral" visible ="false" style="color:red;font-weight:700"></div>
    <asp:Panel ID="ApproveRecordPanel" runat="server" Visible="false" >
         <asp:Label ID="Label1" runat="server" Text="Pending approve record:"></asp:Label>
           <br/>
          <br/>
         <asp:Label ID="ApproveRecordPanelChangeDiscriptionLabel" runat="server" Text="Change Discription:"></asp:Label>
          <br/>
         <br/>
         <textarea  runat="server" id="ApproveRecordPanelChangeDiscriptionTextArea" cols="80" rows="6" readonly="readonly" ></textarea>
          <br/>
          <br/>
           <span style="font-weight:700;color:red">Please click the Site Home button in the left Navigation if you want to review the changes.</span>
          <br/>
          <br/>
           <asp:Label ID="ApproveRecordPanelCreateByLabel" runat="server" Text="Submitted by Abraham Cheng at 2014/03/29"></asp:Label>
           <br/>
          <br/>
           <asp:Label ID="CommentsLabel" runat="server" Text="Comments:"></asp:Label>
          <br/>
          <textarea  runat="server" id="ApproveCommentsTextarea" cols="80" rows="6"  ></textarea>
         <br/>
         <br/>
         <asp:Button ID="ApproveButton" runat="server" Text="Approve" OnClick="ApproveButton_Click"  OnClientClick="return ValidateInput();" />
         <asp:Button ID="RejectButon" runat="server" Text="Reject"  OnClick="RejectButton_Click"  OnClientClick="return ValidateInput();"/>
         <asp:Label ID="ApproveByLabel" runat="server" Text="Approve by Abraham Cheng at 2014/03/29"></asp:Label>
     </asp:Panel>
</asp:Content>

<asp:Content ID="PageTitle" ContentPlaceHolderID="PlaceHolderPageTitle" runat="server">
Approve Page
</asp:Content>

<asp:Content ID="PageTitleInTitleArea" ContentPlaceHolderID="PlaceHolderPageTitleInTitleArea" runat="server" >
This is a approve Page
</asp:Content>
